home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 17
/
CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso
/
CUCD
/
Programming
/
DiceSource
/
master
/
Examples
/
Led
/
led.c
next >
Wrap
C/C++ Source or Header
|
1994-02-01
|
617b
|
40 lines
/*
* Simple program to flash the LED
*
*/
#include <exec/types.h>
#include <exec/tasks.h>
#include <dos/dos.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
main(ac, av)
int ac;
char *av[];
{
struct Task *task = FindTask(NULL);
short n = 500;
/*
* actual loop
*/
puts("\nWatch the Power LED and Press ^C to quit!\n");
while ((task->tc_SigRecvd & SIGBREAKF_CTRL_C) == 0) {
short i;
short j;
for (i = 0; i < n; ++i) {
for (j = 0; j < i; ++j)
*(char *)0xBFE001 |= 0x02;
for (j = i; j < n; ++j)
*(char *)0xBFE001 &= ~0x02;
}
}
return(0);
}